def openWrite():
    import nuke,os,subprocess,webbrowser,sys
    wL = nuke.selectedNodes()
    if not len(wL) == 0:
        for w in wL:
            [xpos,ypos] = [w.xpos(),w.ypos()]
            wFileName = w['file'].evaluate()
            if w.Class() in ['Write','Read','DeepRead']:
                if '%v' in wFileName:
                    path = wFileName.split('%v')[0]
                    views = nuke.root()['hero_view'].value()
                    filePath = os.path.join(path, views)
                else:
                    filePath = wFileName.split('/')[len(wFileName.split('/'))-1]
                    filePath = wFileName.replace(filePath, "")

# filePath is the final directory of your sequence
# it will dig out the files only if you find a real path

                if os.path.isdir(filePath): 
                    platformName = sys.platform
                    if 'linux' in platformName:    
                        subprocess.Popen(["xdg-open",filePath])
                    elif 'win' in platformName:
                        webbrowser.open(filePath)
                else:
                    nuke.message('not a path')
    else:
        nuke.message('No write or read nodes are selected')
